package com.cnzz.site1255174697;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.multidex.MultiDex;

import com.ali.auth.third.core.callback.InitResultCallback;
import com.cqyanyu.yanyu.db.XDB;
import com.cqyanyu.yanyu.http.XHttpManagerImpl;
import com.cqyanyu.yanyu.model.UserInfoEntity;
import com.facebook.drawee.backends.pipeline.Fresco;

import org.xutils.x;



/**
 * Created by cheng on 2016/6/13.
 */
public class MyApp extends Application {
    private static MyApp myApp;
    private Object object;


    @Override
    public void onCreate() {
        super.onCreate();
        myApp = this;
        Fresco.initialize(this);
        x.Ext.setDebug(com.cqyanyu.yanyu.BuildConfig.DEBUG); // 是否输出debug日志, 开启debug会影响性能.
        x.Ext.init(this);
        XHttpManagerImpl.registerInstance();
    }

    public static MyApp getInstance() {
        if (myApp == null) {
            myApp = (MyApp) (x.app());
        }
        return myApp;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

    public <T extends Object> T getObject() {
        return (T) object;
    }

    public void setObject(Object object) {
        this.object = object;
    }


}
